package cn.zhf.shop.service.impl;

import cn.zhf.shop.entity.Message;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import cn.zhf.shop.mapper.RebateLevelMapper;
import cn.zhf.shop.entity.RebateLevel;
import cn.zhf.shop.service.RebateLevelService;

@Service
public class RebateLevelServiceImpl implements RebateLevelService {

    @Resource
    private RebateLevelMapper rebateLevelMapper;

    @Override
    public Message deleteByPrimaryKey(Integer rebateLevelId) {
        return rebateLevelMapper.deleteByPrimaryKey(rebateLevelId) > 0 ? Message.success(null) : Message.fail(null);
    }

    @Override
    public Message insert(RebateLevel record) {
        return rebateLevelMapper.insert(record) > 0 ? Message.success(null) : Message.fail(null);
    }

    @Override
    public Message insertSelective(RebateLevel record) {
        return rebateLevelMapper.insertSelective(record) > 0 ? Message.success(null) : Message.fail(null);
    }

    @Override
    public Message<RebateLevel> selectByPrimaryKey(Integer rebateLevelId) {
        return Message.success(null).add(rebateLevelMapper.selectByPrimaryKey(rebateLevelId));
    }

    @Override
    public Message updateByPrimaryKeySelective(RebateLevel record) {
        return rebateLevelMapper.updateByPrimaryKeySelective(record) > 0 ? Message.success(null) : Message.fail(null);
    }

    @Override
    public Message updateByPrimaryKey(RebateLevel record) {
        return rebateLevelMapper.updateByPrimaryKey(record) > 0 ? Message.success(null) : Message.fail(null);
    }

    @Override
    public Message<List<RebateLevel>> selectAll() {
        return Message.success(null).add(rebateLevelMapper.selectAll());
    }

}



